
import QtQuick 1.0


Item {
    id: progressbar

    property real minimum: 0
    property real maximum: 100
    property real value: 0
    property alias color: gradient1.color
    property alias secondColor: gradient2.color

    width: 250; height: 23
    clip: true

    Rectangle {
        id: highlight
        smooth: true

        property int heightDest: ((progressbar.height * (value - minimum)) / (maximum - minimum))

        anchors { left: parent.left; right: parent.right; bottom: parent.bottom; margins: 0 }
        radius: 8
        height: highlight.heightDest

        Behavior on height { SmoothedAnimation { velocity: 100 } }

        gradient: Gradient {
            GradientStop { id: gradient1; position: 0.0 }
            GradientStop { id: gradient2; position: 1.0 }
        }
    }



    /*
     Rectangle {
         id: highlight

         property int widthDest: ((progressbar.width * (value - minimum)) / (maximum - minimum) - 6)

         width: highlight.widthDest
         Behavior on width { SmoothedAnimation { velocity: 1200 } }

         anchors { left: parent.left; top: parent.top; bottom: parent.bottom; margins: 3 }
         radius: 1
         gradient: Gradient {
             GradientStop { id: gradient1; position: 0.0 }
             GradientStop { id: gradient2; position: 1.0 }
         }
     }
*/


}
